Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
Mac and OpenDoc are trademarks of Apple Computer, Inc.
Introduction
The fourth item in the OpenDoc “Document” menu is “Insert…” which a user chooses if they want to insert a part from a disk using the Standard File interface. This recipes serves as sample code to do this.
Caveats
• This code does NOT replicate the code for Cloning and Embedding. Please see the Clipboard recipe for that code.
• It does not contain proper error checking
• It does not account for the case where a part may want to Insert… a file which is not an OpenDoc part.
• It does not properly filter out files which are not ODContainers
• Instead of kODDefaultFileContainer, it should use file->GetContainerType()
• It uses the PlatformFile class which is an unsupported private utility class of OpenDoc
• It always embeds the inserted part, whereas some part editors may want to incorporate inserted content.